package com.aspose.cells;

public class TickLabels {
   private Axis a;
   private Font b;
   private int c = -1;
   private boolean d = true;
   private int e = 0;
   private int f;
   private boolean g = true;
   private String h;
   private int i = 0;
   private boolean j = true;
   private int k = 100;
   private boolean l = false;
   private boolean m = false;
   private int n;

   TickLabels(Axis axis) {
      this.a = axis;
      if (axis.a().getChartArea() != null) {
         this.d = axis.a().getChartArea().getAutoScaleFont();
      }

   }

   public Font getFont() {
      if (this.b == null) {
         this.b = new Font(this.a.a().j(), (Object)null, true);
         this.b.setSize(10);
         Font var1 = null;
         if (this.c != -1) {
            var1 = this.a.a().j().j(this.c);
            if (var1.b.a() && this.a.a().getStyle() > 40) {
               var1.setColor(this.a.a().getWorksheet().getWorkbook().c.a("lt1"));
            }

            this.b.c(var1);
            this.b.b.b(true);
            zbi var2 = this.a.a().c(this.c);
            if (var2 != null) {
               zbi var3 = new zbi(var2.f, 0, false);
               var3.a(var2);
               this.b.a((Object)var3);
            }
         } else {
            var1 = this.a.a().getChartArea().getFont();
            this.b.c(var1);
            if (this.getAutoScaleFont()) {
               this.b.a((Object)(new zbi(this.a.a(), this.b.getSize(), true)));
            }
         }
      }

      return this.b;
   }

   Font a() {
      return this.b == null && this.c != -1 ? this.a.a().j().j(this.c) : this.b;
   }

   int b() {
      return this.c;
   }

   void a(int var1) {
      this.c = var1;
   }

   public boolean getAutoScaleFont() {
      return this.d;
   }

   public void setAutoScaleFont(boolean value) {
      if (this.d != value) {
         if (value) {
            if (this.b != null) {
               this.b.a((Object)(new zbi(this.a.a(), this.b.getSize(), true)));
            }
         } else {
            this.getFont().a((Object)null);
         }

         this.d = value;
      }
   }

   void a(boolean var1) {
      this.d = var1;
   }

   public int getBackgroundMode() {
      return this.e;
   }

   public void setBackgroundMode(int value) {
      this.e = value;
   }

   /** @deprecated */
   public int getBackground() {
      return this.e;
   }

   /** @deprecated */
   public void setBackground(int value) {
      this.e = value;
   }

   /** @deprecated */
   public int getRotation() {
      return this.f;
   }

   /** @deprecated */
   public void setRotation(int value) {
      if ((value < -90 || value > 90) && value != 255) {
         throw new IllegalArgumentException("Invalid tick labels rotation.");
      } else {
         this.f = value;
         this.g = false;
      }
   }

   public int getRotationAngle() {
      return this.f;
   }

   public void setRotationAngle(int value) {
      if ((value < -90 || value > 90) && value != 255) {
         throw new CellsException(0, "Invalid tick labels rotation.");
      } else {
         this.f = value;
         this.g = false;
      }
   }

   void b(int var1) {
      this.f = var1;
      this.g = false;
   }

   boolean c() {
      return this.g;
   }

   public String getNumberFormat() {
      return this.h;
   }

   public void setNumberFormat(String value) {
      this.i = 0;
      this.h = value;
      this.j = false;
   }

   public int getNumber() {
      return this.i >= 0 && this.i < 59 ? (byte)this.i : 0;
   }

   public void setNumber(int value) {
      if (value < 59 && value >= 0) {
         this.h = null;
         this.i = value;
      } else {
         this.i = value;
      }

      this.setNumberFormatLinked(false);
   }

   int d() {
      return this.i;
   }

   void c(int var1) {
      this.i = var1;
   }

   public boolean getNumberFormatLinked() {
      return this.j;
   }

   public void setNumberFormatLinked(boolean value) {
      this.j = value;
   }

   public int getOffset() {
      return this.k;
   }

   public void setOffset(int value) {
      if (value >= 0 && value <= 1000) {
         this.k = value;
      } else {
         throw new IllegalArgumentException("The tick offset must be between 0 and 1000.");
      }
   }

   boolean e() {
      return this.l;
   }

   void b(boolean var1) {
      this.l = var1;
   }

   boolean f() {
      return this.m;
   }

   void c(boolean var1) {
      this.m = var1;
   }

   public int getTextDirection() {
      return this.n;
   }

   public void setTextDirection(int value) {
      this.n = value;
   }

   void a(TickLabels var1) {
      this.d = var1.d;
      this.c = -1;
      if (var1.b == null && var1.c == -1) {
         this.b = null;
      } else {
         this.b = new Font(this.a.a().j(), (Object)null, true);
         this.b.c(var1.getFont());
         if (var1.getFont().c() != null && var1.d) {
            zbi var2 = (zbi)var1.getFont().c();
            zbi var3 = new zbi(this.a.a(), 0, false);
            var3.a(var2);
            this.b.a((Object)var3);
         }
      }

      this.h = var1.h;
      this.i = var1.i;
      this.j = var1.j;
      this.f = var1.f;
      this.g = var1.g;
      this.k = var1.k;
      this.e = var1.e;
      this.l = var1.l;
      this.n = var1.n;
   }
}
